package com.jh.complicate.serializable;

import java.io.ObjectInputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author Administrator
 * @projectName newforward
 * @title ServerSocketProvider.java
 * @package com.jh.complicate.serializable
 * @description SocketServer传输对象，服务端
 * @date 2019/6/4 18:15
 */
public class ServerSocketProvider {
    public static void main(String[] args) throws Exception{
        ServerSocket serverSocket = new ServerSocket(8080);
        Socket socket = serverSocket.accept();

        ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
        User user = (User) ois.readObject();

        System.out.println(user);

        socket.close();
        serverSocket.close();
    }
}
